﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebManager;

namespace WebManager.Function.PortalList
{
    public partial class New : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if(!Page.IsPostBack)
            {
                Label label = Page.Master.FindControl("lblTitle") as Label;
                label.Text = "<b>添加PortalList</b>";
             }
        }

        protected void Save_Click(object sender, EventArgs e)
        {
            LYQ.BLL.PortalList bll = new LYQ.BLL.PortalList();
            LYQ.Model.PortalList model = new LYQ.Model.PortalList();
            model.PortalID = bll.GetMaxId();
            model.PortalName = txtPortalName.Text;
            model.Limit = Convert.ToInt32(txtLimit.Text);
            model.Description = txtDescription.Text;

            bll.Add(model);

            string url = URLUtility.UrlBase + "/WebManager/Function/PortalList/List.aspx";
            Page.Response.Redirect(url);
        }

        protected void Cancel_Click(object sender, EventArgs e)
        {
            string url = URLUtility.UrlBase + "/WebManager/Function/PortalList/List.aspx";
            Page.Response.Redirect(url);
        }
    }
}
